<?php
/**
 * Created by PhpStorm.
 * User: function
 * Date: 2018-04-12
 * Time: 16:58
 */

namespace app\api\controller\v1;
use app\common\controller\Api;
use app\common\logic\AdLogic;

class Ad extends Api
{
    protected $authenticate = ['only'=>'fdsa'];
    
    protected $pid_rule = [
        'pid|广告位id'  => 'require',
    ];
    
    public function place($pid){
        $logic = new AdLogic();
        $filter = ['open'=>1];//前端只获取开启的
        if($pid!=0){
            $filter['pid'] = $pid;
        }
        $lists = $logic->getPlaceList($filter);
        return $lists;
        
    }
    
    public function index(){
        $params = paramForm();
        $this->validate($params,$this->pid_rule);//表单校验
        parent::index();
    }


    
    
  
    
}